#!/usr/bin/R
gss <- read.table("file.out", header=TRUE)
gss <- transform(gss, new=g1/ilp, new=g2/ilp, new=g3/ilp, new=g4/ilp)
names(gss)[11]='g1rat'
names(gss)[12]='g2rat'
names(gss)[13]='g3rat'
names(gss)[14]='g4rat'
means <- c(NA,NA,gss$segs[1],mean(gss$intersections),mean(gss$deg2),mean(gss$ilp),mean(gss$g1),mean(gss$g2),mean(gss$g3),mean(gss$g4),mean(gss$g1rat),mean(gss$g2rat),mean(gss$g3rat),mean(gss$g4rat))
names(means)=names(gss)
write.table(gss, file="pretty.tab", append=FALSE, quote = FALSE, sep = "\t")
write.table(t(means), file="pretty.tab", append=TRUE, quote = FALSE, sep = "\t",col.names = FALSE)
